﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmallTune.Models
{
    public class Song
    {
        public virtual int id { get; set; }
        public virtual string path { get; set; }
        public virtual IList<Genre> listOfGenres { get; set; }
        public virtual string title { get; set; }
        public virtual int timesPlayed { get; set; }
        public virtual bool isStarred { get; set; }
        public virtual bool isPlaying { get; set; }
        public virtual double rating { get; set; }
        public virtual string checksum { get; set; }
        public virtual DateTime lastChanged { get; set; }
        public virtual DateTime created { get; set; }
        public virtual DateTime lastPlayed { get; set; }
        public virtual string fullTextIndex { get; set; }
        public virtual IList<Artist> listOfArtists { get; set; }
        public virtual IList<Album> listOfAlbums { get; set; }
        public virtual IList<Playlist> listOfPlaylists { get; set; }
        public virtual uint durationInSeconds { get; set; }

        public Song()
        {
            listOfAlbums = new List<Album>();
            listOfArtists = new List<Artist>();
            listOfPlaylists = new List<Playlist>();
            listOfGenres = new List<Genre>();
        }

        public virtual void AddArtist(Artist artist)
        {
            artist.listOfSongs.Add(this);
            listOfArtists.Add(artist);
        }

        public virtual void AddGenre(Genre genre)
        {
            genre.listOfSongs.Add(this);
            listOfGenres.Add(genre);
        }
    }
}
